package com.pattern.singleton;

public class Captain1 {
    //Early initialization
    private static final Captain1 captain = new Captain1();

    //We make the constructor private to prevent the use of "new"
    private Captain1() {
        System.out.println("A captain is elected for your team.");
    }

    /* Global point of access.The method getCaptain() is a public static
    method*/
    public static Captain1 getCaptain() {
        System.out.println("You have a captain for your team.");
        return captain;
    }
}
